export default function download(url) {
    fetch(url)
        .then(response => response.blob())
        .then(blob => {
            const url = window.URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = 'download.docx'; // 文件名
            document.body.appendChild(a);
            a.click(); // 触发下载
            document.body.removeChild(a);
            window.URL.revokeObjectURL(url); // 释放内存
        })
        .catch(err => console.error('下载失败:', err));
}